﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH4_2102A.Shopping.Domain
{


    /// <summary>
    /// SKU表
    /// </summary>
    [Table("tb_sku")]
    public class SKUModel : AuditField
    {
        public Guid Id { get; set; }

        public Guid SPUId { get; set; }

        //库存--数量
        public int SourceStock { get; set; } //累计库存
        public int ValidStock { get; set; }//可用库存、有效库存
        public int LockStock { get; set; }//锁定库存
        public int SaleNumber { get; set; }//累计销售数量

        //价格
        public decimal InPrice { get; set; } //进价
        public decimal SalePrice { get; set; }//售价
        public decimal MarketPrice { get; set; } //市场价

        //规格
        public string Spec { get; set; } //   {"颜色":"红色","内存":"512G" }

        //图片---主图
        public string Cover { get; set; }

        //浏览量
        public int? BlowNumber { get; set; } = 0;
        
        //从右往右(1表示真，0表示假)
        //第1位：上下架
        //第2位：推荐
        //第3位：特价
        //第4-10：预留
        /// <summary>
        /// 标识字段
        /// </summary>
        public string Flag { get; set; } = "1000000000";

        /// <summary>
        /// 上下架
        /// </summary>
        public bool? State { get; set; } = true;


        /// <summary>
        /// 乐观锁--时间戳
        /// </summary>
        [Timestamp]
        public byte[] TimeStamp { get; set; }

    }
}
